<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>{$tpshop_config['shop_info_store_title']}</title>
    <meta http-equiv="keywords" content="{$tpshop_config['shop_info_store_keyword']}" />
    <meta name="description" content="{$tpshop_config['shop_info_store_desc']}" />
    <link rel="stylesheet" href="__STATIC__/css/index.css" type="text/css">
    <script src="__STATIC__/js/jquery-1.10.2.min.js"></script>
    <script src="__STATIC__/js/slider.js"></script>
    <script src="__PUBLIC__/js/layer/layer.js"></script><!--弹窗js 参考文档 http://layer.layui.com/-->    
    <script src="__PUBLIC__/js/global.js"></script>
</head>

<body style="background:RGB(242,242,242)">
<div class="uc">
    <div class="uc_head">
        <div class="uc_head_middle">
            <div class="uc_head_middle_left">TPSHOP</div>
            <!--<div class="uc_head_middle_right"><a class="logout_c" href="">问问</a> | <a class="logout_c" href="">退出</a></div>-->
        </div>
    </div>
    <div class="uc_body pa-to-30">
        <div class="uc_body_form">
            <form action="" method="post">
                <table class="changeAccount_theme">
                    <tbody>
                    <tr class="tr_height">
                        <td class="cl_left fo-si-12" align="right"><label class="fo-si-12">账号：</label></td>
                        <td class="cl_middle">
                            <input type="text" class="imput_text text_width foce" id="username" name="username" placeholder="请填写您的手机或者邮箱">
                        </td>
                        <td>
                            <span id="msg_txtMailAccount"></span>
                        </td>
                    </tr>
                    <tr class="tr_height">
                        <td align="right" class="cl_left">
                            验证码：
                        </td>
                        <td class="cl_middle">
                            <input type="text" id="code" maxlength="4" style="width:100px;" placeholder="没有请留空" class="imput_text" name="code">
                            <input type="button" id="count_down" intervaltime="60" value="获取验证码 " id="btnemailAuthCode1" onclick="send_code()">
                        </td>

                    </tr>
                    <tr class="tr_height">
                        <td class="cl_left fo-si-12" align="right"><label class="fo-si-12">新密码：</label></td>
                        <td class="cl_middle">
                            <input type="text" class="imput_text text_width foce" id="new_password" name="new_password">
                        </td>
                    </tr>
                    <tr class="tr_height">
                        <td class="cl_left fo-si-12" align="right"><label class="fo-si-12">确认新密码：</label></td>
                        <td class="cl_middle">
                            <input type="text" class="imput_text text_width foce" id="confirm_password" name="confirm_password">
                        </td>
                    </tr>
                    <tr class="tr_height">
                        <td valign="middle" align="center" colspan="3" style="height:120px;">
                            <input type="submit" value="下一步" class="btn_midefy" id="btn_next">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3"></td>
                    </tr>
                    </tbody>
                </table>

            </form>
        </div>
    </div>

</div>
<script>
    function sendCode(obj,input_id){

        //发送验证码
        $.ajax({
            type : "GET",
            url  : url,
            error: function(request) {
                layer.alert('服务器繁忙, 请联系管理员!', {icon: 2});//alert("服务器繁忙, 请联系管理员!"); 
                return;
            },
            success: function(v) {
                jsInnerTimeout(id);
            }
        });
    }

    //倒计时函数
    function jsInnerTimeout(id)
    {
        var codeObj=$("#"+id);
        var intAs=parseInt(codeObj.attr("IntervalTime"));

        intAs--;
        codeObj.attr("disabled","disabled");
        if(intAs<=-1)
        {
            codeObj.removeAttr("disabled");
            codeObj.attr("IntervalTime",60);
            codeObj.val("获取验证码");
            return true;
        }

        codeObj.val(intAs+'s后再次获取');
        codeObj.attr("IntervalTime",intAs);

        setTimeout("jsInnerTimeout('"+id+"')",1000);
    };
    
    function send_code(){
        var username = $('#username').val();
        var url = '';
        if(checkMobile(username)){
           url = "/index.php?m=Home&c=User&a=send_sms_reg_code&mobile="+username;
        }
        if(is_email(username)){
           url = "/index.php?m=Home&c=User&a=send_forget_code&email="+username;
        }
        $.get(url,function(data){
            obj = $.parseJSON(data);
            if(obj.status==1)
                jsInnerTimeout('count_down');            
                layer.alert(obj.msg, {icon: 2});//alert(obj.msg);	
        })
    }
</script>
</body>
</html>
